<template>
	<view class="home-wrap">
		<!-- 滑动页面 -->
		<view class="page">
			<my-swiper :list="tabBarList" :current="swiperCurrent"></my-swiper>
		</view>
		<!-- 导航栏 -->
		<view class="tabBar">
			<my-tabBar :list="tabBarList" :current="tabBarCurrent"></my-tabBar>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabBarList: [ 
					{ id:1, title:'Library',  icon:'iconxiangmu' },
					{ id:2, title:'Commend',  icon:'iconaixin' },
					{ id:3, title:'Browse',  icon:'iconyinle' },
					{ id:4, title:'Me',  icon:'iconwode-active' }
				],
				tabBarCurrent: 0,
				swiperCurrent: 0,
			};
		},
		onShow() {
			uni.$on("myTabBarOnChange", res => {
				this.swiperCurrent = res;
				
			})
			uni.$on("mySwiperOnChange", res => {
				this.tabBarCurrent = res;
	
			})
		},
		methods:{
			
		}
	}
</script>

<style lang="scss" scoped>
@import './home.scss';
</style>
